package com.lei.session.util;

import java.util.List;

import com.lei.session.entity.Permission;

public class PremissionUtil {
	/**
	 * 是否有权限
	 * @param premissionList 权限列表
	 * @param premissionCode 权限码
	 * @return true/false
	 */
	public static boolean checkPremission(List<Permission> premissionList,String premissionCode) {
		if(premissionList==null ||premissionList.isEmpty()) {
			return false;
		}
		for(Permission premission:premissionList) {
			if(premission.getPermissionNumber().equals(premissionCode)) {
				return true;
			}
		}
		return false;
	}
}
